package com.hanbang.taitaigou.ui.activity.gouwuche;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.hanbang.taitaigou.R;
import com.hanbang.taitaigou.ui.activity.aboutme.myOrder.AboutMyOrderActivity;
import com.hanbang.taitaigou.ui.activity.base.BaseActivity;
import com.hanbang.taitaigou.ui.activity.home.MainActivity;

/**
 * Created by fanxin on 2016/4/1.
 */
public class PaymentSuccessActivity extends BaseActivity {

    private RelativeLayout rl_chakan_my_order;
    private ImageView top_bar_left_iv;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.payment_success);
        initView();
        setOnClickListener();
    }

    /*
     * 设置点击事件
     */
    private void setOnClickListener() {
        rl_chakan_my_order.setOnClickListener(onClickListener);
        top_bar_left_iv.setOnClickListener(onClickListener);
    }

    @SuppressWarnings("unused")
    private View.OnClickListener onClickListener = new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            Intent intent = new Intent();
            switch (v.getId()) {
                case R.id.rl_chakan_my_order:

                    intent.setClass(PaymentSuccessActivity.this, AboutMyOrderActivity.class);
                    startActivity(intent);
                    finish();
                    break;
                case R.id.top_bar_left_iv:
                    intent.setClass(PaymentSuccessActivity.this, MainActivity.class);
//                    intent.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);
                    startActivity(intent);
                    finish();
                    break;
                default:
                    break;
            }
        }
    };

    /*
     * 初始化view
     */
    private void initView() {


        top_bar_left_iv = (ImageView)findViewById(R.id.top_bar_left_iv);
        rl_chakan_my_order = (RelativeLayout)findViewById(R.id.rl_chakan_my_order);
    }

}
